﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BI.CF.Factory;
using BI.CF.Model;
using BI.CF.IDAL;

namespace BI.CF.BLL
{
    public class BulletinBLL
    {
        static CF_Factory fac = CF_Factory.DataBaseType();
        BulletinIDAL ServiceFac = fac.BulletinFactry();


        /// <summary>
        /// 广告显示
        /// </summary>
        /// <returns></returns>
        public List<BulletinModel> BulletinShowOne(int tid)
        {
            return ServiceFac.BulletinShowOne(tid);
        }
        /// <summary>
        /// 广告详细信息
        /// </summary>
        /// <returns></returns>
        public BulletinModel BulletinContentShow(int id)
        {
            return ServiceFac.BulletinContentShow(id);
        }
        /// <summary>
        /// 根据名称查询广告ID
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public int BulletinIDshow(string name)
        {
            return ServiceFac.BulletinIDshow(name);
        }
        /// <summary>
        /// 修改浏览量
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool BulletinUpdatePV(int id)
        {
            return ServiceFac.BulletinUpdatePV(id);
        }



        //后台数据处理
        /// <summary>
        /// 广告类型显示
        /// </summary>
        /// <returns></returns>
        public List<PublishTypeModel> PublishTypeShow()
        {
            return ServiceFac.PublishTypeShow();
        }
        /// <summary>
        /// 广告类型删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool PublishTypeDelete(int id)
        {
            return ServiceFac.PublishTypeDelete(id);
        }
        /// <summary>
        /// 修改反填新闻类别信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public PublishTypeModel fantian(int id)
        {
            return ServiceFac.fantian(id);
        }
        /// <summary>
        /// 修改广告类型
        /// </summary>
        /// <param name="id"></param>
        /// <param name="name"></param>
        /// <returns></returns>
        public bool PublishTypeUpdate(PublishTypeModel upd)
        {
            return ServiceFac.PublishTypeUpdate(upd);
        }
        /// <summary>
        /// 修改广告详细信息
        /// </summary>
        /// <param name="upd"></param>
        /// <returns></returns>
        public bool BulletinUpdate(BulletinModel upd)
        {
            return ServiceFac.BulletinUpdate(upd);
        }
        /// <summary>
        /// 广告详细信息显示
        /// </summary>
        /// <returns></returns>
        public List<BulletinModel> BulletinShowAll(int pageSize, int pageIndex, string name)
        {
            return ServiceFac.BulletinShowAll(pageSize,pageIndex,name);
        }
        /// <summary>
        /// 查询广告类型总条数
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public int BulletinCount(string name)
        {
            return ServiceFac.BulletinCount(name);
        }


        public BulletinModel Bullid(int id)
        {
            return ServiceFac.Bullid(id);
        }


        public bool BullUpt(BulletinModel upd)
        {

            return ServiceFac.BullUpt(upd);
        }

    }
}
